package com.wc.AlgoOJ_train.train1.c6.A611;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/10 22:28
 * @description 单词数
 * http://43.138.190.70:8888/p/A611
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            String s = sc.nextLine();
            if (s.equals("#")) {
                return;
            }
            String[] words = s.split("\\s+");
            HashSet<String> set = new HashSet<>(Arrays.asList(words));
            System.out.println(set.size());
        }
    }
}
